{template 'header'}
<!--当前位置-->
<div class="location layout960 fn-clear">
	当前位置: <a href="{SITE_URL}">首页</a>&nbsp;»&nbsp; <a href="./">广告服务</a>
	<a class="ad-my" href="{$MODULE[2][linkurl]}ad.php">[我的广告]</a>
</div>
<!--当前位置 end-->
<div class="layout960 fn-clear">
	<!--广告位头部 start-->
	<div class="ad-hd fn-clear">
		{php $ad_cats = xd_ext_ad_cats()}
		{if $catid}
		{php $types = get_type('ad_place')}
		<h2 class="fn-left">{$types[$catid][typename]}</h2>
		{else}
		<h2 class="fn-left">全部广告位</h2>
		{/if}
		<div class="ad-nav fn-right">
			<ul>
				<li class="js-ad-nav">
					<a href="?">分站</a>
					{if $ad_cats[sub]}
					<ul class="fn-hide">
						{loop $ad_cats[sub] $av}
						<li><a href="?catid={$av[typeid]}">{$av[typename]}</a></li>
						{/loop}
					</ul>
					{/if}
				</li>
				<li class="js-ad-nav">
					<a href="?">总站</a>
					{if $ad_cats[all]}
					<ul class="fn-hide">
						{loop $ad_cats[all] $av}
						<li><a href="?catid={$av[typeid]}">{$av[typename]}</a></li>
						{/loop}
					</ul>
					{/if}
				</li>
				<li><a href="?">全部广告位</a></li>
			</ul>
            <script>
                seajs.use(["$"],function($){
                    var $adNav = $("li.js-ad-nav");
                    $adNav.hover(function(){
                        $(this).children("ul").slideDown(100);
                    },function(){
                        $(this).children("ul").slideUp(100);
                    });
                })
            </script>
		</div>
	</div>
	<!--广告位头部 start-->
	<!--广告位列表 start-->
	<div class="ad-space-list">
		<table cellpadding="6" cellspacing="1" width="938px"align="center">
			<thead>
			<tr>
				<th width="298">广告位名称(点击预览)</th>
				{if !$typeid}<th width="200">广告类型</th>{/if}
				<th width="140">规格(px)</th>
				<th width="81" title="({$DT[money_unit]}/月)">价格</th>
				<th width="81" title="({$DT[money_unit]}/月)">单位</th>
				{if $MOD[ad_buy]}<th width="301">申请</th>{/if}
			</tr>
			</thead>
			<tbody>
			{loop $ads $k $v}
			<tr title="{$v[introduce]}">
				{if $v[linkurl]}
				<td><a target="_blank" href="{$v[linkurl]}" title="效果预览">{$v[name]}</a></td>
				{else}
				{$v[name]}
				{/if}
				{if !$typeid}<td><a href="{rewrite('index.php?typeid='.$v['typeid'])}">{$v[typename]}</a></td>{/if}
				<td>{$v[width]} x {$v[height]}</td>
				<td>{if $v[price]}{$v[price]}{else}另议{/if}</td>
				<td>{$unit}</td>
				<td>
					{if $MOD[ad_buy]}
					<a class="ad-apply-btn" href="{rewrite('index.php?action=buy&pid='.$v['pid'])}" title="申请">申请</a>
					<a class="ad-preview-btn" href="{$v[linkurl]}" title="预览">点击预览</a>
					{/if}
				</td>
			</tr>
			{/loop}
			</tbody>
		</table>
		<div class="pages clear" style="padding-left:250px;">
			<div id="page-form" class="page-form" >
				<div class="fn-left fn-clear">
					{php $do->getPn()->render()}
				</div>
			</div>
            <script type="text/javascript">
                seajs.use(['$','lm-util'],function($,util){
                    $(".page-form").find("button").click(function(){
                        var pageNum = $('#xd_page_jump').val();
                        util.xdChangeAndLocation('page', pageNum);
                    });
                });
            </script>
		</div>
	</div>
	<!--广告位列表 end-->
</div>
<!--主体部分 end-->
{template 'footer'}